<template>
  <!-- <div>子组件 - {{ count }}</div> -->
  <div>子组件 - {{ props.count }}</div>
</template>

<!-- <script>
import { onMounted } from "vue";
export default {
  props: ["count"],
  emits: ["abc"],
  // setup是有第一个参数的，参数就是props
  setup(props, { emit }) {
    onMounted(() => {
      // console.log(props.count);
      // console.log(ctx);
      emit("abc");
    });
  },
};
</script> -->

<script setup>
import { onMounted } from "vue";
// const props = defineProps(["count"]);
const props = defineProps({
  count: Number,
});
const emit = defineEmits(["abc"]);

onMounted(() => {
  console.log(props.count);
  emit("abc", 999);
});
</script>
